<?php
class YouNet_Form_Element_Moderators extends Zend_Form_Element_Text
{
	private $_specs = 'email_notify';
	private $_options = array(
			'label'		=> "Email of moderators <span class='tooltip_label' title='Send notification email to these moderators when there is new comment on your page or receive a message from your Fans.'>[?]</span>",
			'required'	=> false,
			'filters'	=> array('StringTrim'),
            'description' => "List of emails separated by comma (,)"
		);
	
	public function __construct($specs = NULL, $options = NULL)
	{
		if (isset($specs))
			$this->_specs = $specs;
		if (isset($options))
			$this->_options = array_merge($this->_options, $options);
			
		parent::__construct($this->_specs, $this->_options);
		$this->addValidator('regex', true, array('/^[\w\d\-\_\.]+\@([\w\d\-]+\.){1,2}[\w\d]+(\s*\,\s*[\w\d\-\_\.]+\@([\w\d\-]+\.){1,2}[\w\d]+)*$/'))
                ->addErrorMessage("The email address is invalid. Please re-enter.");
		$this->getDecorator('Label')->setOption('escape',false);                
	}
}